Telegram Group & Telegram Channel
🐍 Задача для собеседования на Python

Условие:
def mystery(x, y):
if x == 0:
return y
else:
return mystery(x - 1, x + y)

result = mystery(3, 2)
print(result)

— Вопрос: что будет выведено в результате выполнения этого кода?

Варианты ответов:
А. 5
B. 8
C. 11
D. Ошибка рекурсии

Правильный ответ: B.

Пояснение:
Функция
mystery — это рекурсивная функция, которая накапливает сумму чисел от x до 1, прибавляя y в конце.

@python_job_interview



tg-me.com/python_job_interview/1128
Create:
Last Update:

🐍 Задача для собеседования на Python

Условие:

def mystery(x, y):
if x == 0:
return y
else:
return mystery(x - 1, x + y)

result = mystery(3, 2)
print(result)

— Вопрос: что будет выведено в результате выполнения этого кода?

Варианты ответов:
А. 5
B. 8
C. 11
D. Ошибка рекурсии

Правильный ответ: B.

Пояснение:
Функция
mystery — это рекурсивная функция, которая накапливает сумму чисел от x до 1, прибавляя y в конце.

@python_job_interview

BY Python вопросы с собеседований


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python_job_interview/1128

View MORE
Open in Telegram


Python вопросы с собеседований Telegram | DID YOU KNOW?

Date: |

For some time, Mr. Durov and a few dozen staffers had no fixed headquarters, but rather traveled the world, setting up shop in one city after another, he told the Journal in 2016. The company now has its operational base in Dubai, though it says it doesn’t keep servers there.Mr. Durov maintains a yearslong friendship from his VK days with actor and tech investor Jared Leto, with whom he shares an ascetic lifestyle that eschews meat and alcohol.

Importantly, that investor viewpoint is not new. It cycles in when conditions are right (and vice versa). It also brings the ineffective warnings of an overpriced market with it.Looking toward a good 2022 stock market, there is no apparent reason to expect these issues to change.

Python вопросы с собеседований from br


Telegram Python вопросы с собеседований
FROM USA